Creates a two colour binned gradient (low-high), creates a diverging binned colour gradient (low-mid-high), and creates a n-colour binned gradient. and then convert it to ggplotly.
df <- data.frame(
x = runif(100),
y = runif(100),
z1 = rnorm(100)
)
p <-
ggplot(df, aes(x, y)) +
geom_point(aes(colour = z1)) +
scale_colour_steps()
plotly::ggplotly(p)
df <- data.frame(
x = runif(100),
y = runif(100),
z1 = rnorm(100)
)
p <-
ggplot(df, aes(x, y)) +
geom_point(aes(colour = z1)) +
scale_colour_steps2()
plotly::ggplotly(p)
df <- data.frame(
x = runif(100),
y = runif(100),
z1 = rnorm(100)
)
p <-
ggplot(df, aes(x, y)) +
geom_point(aes(colour = z1)) +
scale_colour_stepsn(colours = terrain.colors(10))
plotly::ggplotly(p)